from django.shortcuts import render
from django.http import HttpResponse
from django.http import JsonResponse
# Create your views here.


def index(request):
    return HttpResponse('11111')


def goods(request,cat_id,goods_id):






    qp = request.GET

    # print(qp)
    # order = qp.get('order')
    # order = qp['order']
    # print(order)
    print(qp)
    order = qp.getlist('order')
    print(order)
    return JsonResponse({'cat_id':cat_id,'goods_id':goods_id})


def register(request):

    data = request.POST
    print(data)

    return HttpResponse('111')


def json(request):

    # body=request.body
    # # print(body)
    # body_str = body.decode()
    # # print(body_str)
    # import json
    # body_dict = json.loads(body_str)
    # print(body_dict)
    # print(request.META)
    print(request.META['SERVER_PORT'])

    return HttpResponse('json')


def method(request):
    print(request.method)
    return HttpResponse('method')


def response(request):
    response = HttpResponse('res',status=400)
    response['name '] = 'qwer'

    return response




